package per.joker;

import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Properties;

/**
 * @author joker
 * @date 2022/5/12 0012 - 17:24
 */
public class Person {
    private String name;
    private int age;
    private Car car;
    private List<Book> books;
    private Map<String,Object> map;
    private Properties prop;

    public Person() {
    }

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }
//    public void initTest(){
//
//    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public Car getCar() {
        return car;
    }

    public void setCar(Car car) {
        this.car = car;
    }

    public List<Book> getBooks() {
        return books;
    }

    public void setBooks(List<Book> books) {
        this.books = books;
    }

    public Map<String, Object> getMap() {
        return map;
    }

    public void setMap(Map<String, Object> map) {
        this.map = map;
    }

    public Properties getProp() {
        return prop;
    }

    public void setProp(Properties prop) {
        this.prop = prop;
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", car=" + car +
                ", books=" + books +
                ", map=" + map +
                ", prop=" + prop +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Person person = (Person) o;
        return age == person.age &&
                Objects.equals(name, person.name) &&
                Objects.equals(car, person.car) &&
                Objects.equals(books, person.books) &&
                Objects.equals(map, person.map) &&
                Objects.equals(prop, person.prop);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, age, car, books, map, prop);
    }
}
